package com.songtech.demo.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * <br>使用的jpa注解
 * <br>注：
 * <br>1、@Id 注解：标识主键
 * <br>2、@Entity 注解：现在的版本可以不写，但为与以后版本的兼容，建议加上
 * <br>3、@Table 注解：类名中间的大写字母前加“_”后与数据库对应表名一致可以不用写，但为与以后版本的兼容，建议加上
 * <br>4、@Column 注解：属性名和数据库对应字段名相同可以不用写，但为与以后版本的兼容，建议加上
 * <br>5、@Transient 注解：表示非数据库字段，不是数据库的属性必须加上
 */
@Entity
@Table(name = "users")
public class UserEntity implements Serializable{
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "id")
	private Long id;
	@Column(name = "userName")
	private String userName;
	@Column(name = "passWord")
	private String passWord;
	@Column(name = "nick_name")
	private String nickName;

	public UserEntity() {
		super();
	}

	public UserEntity(String userName, String passWord) {
		super();
		this.passWord = passWord;
		this.userName = userName;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassWord() {
		return passWord;
	}

	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}


	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Override
	public String toString() {
		return "userName " + this.userName + ", pasword " + this.passWord;
	}
}
